﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 接口
{
    class Program
    {
        static void Main(string[] args)
        {
            Bird bird = new Bird();
            Eagle eagle = new Eagle();

            bird.Eat();
            eagle.Eat();
            eagle.fly();

            Console.ReadKey();
        }

    }
    public class Bird
    {
        public virtual void Eat()
        {
            Console.WriteLine("鸟");
        }
    }

    public class Eagle : Bird,IBird
    {
        public override void Eat()
        {
            Console.WriteLine("鹰");
        }

        public void fly()
        {
            Console.WriteLine("鹰会飞");
        }
    }

    interface IBird
    {
        void fly();
    }
}
